package com.atguigu.gmall.activity.client;

import com.atguigu.gmall.activity.client.impl.ActivityDegradeFeignClient;
import com.atguigu.gmall.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

@FeignClient(value = "service-activity", fallback = ActivityDegradeFeignClient.class, path = "/api/activity")
public interface ActivityFeignClient {


    /**
     * 查询Redis中当日秒杀商品列表
     *
     * @return
     */
    @GetMapping("/inner/seckill/findAll")
    public Result getSeckillGoodsList();


    /**
     * 查询指定秒杀商品信息
     *
     * @param skuId
     * @return
     */
    @GetMapping("/inner/seckill/getSeckillGoods/{skuId}")
    public Result getSeckillGoods(@PathVariable("skuId") Long skuId);


    /**
     * 渲染秒杀订单确认页面相关数据
     * @return
     */
    @GetMapping("/seckill/auth/trade/{skuId}")
    public Result<Map> seckillOrderTrade(@PathVariable("skuId") Long skuId);
}
